game_manager 
{ 
		spawn 
		{
		
//--------------------- Block Trigger ---------------------
		
		create
		{
			classname "trigger_multiple"
			spawnflags "4" // allied_only
			target "blocktrigger"
			scriptname "blocktrigger1"
			origin "6530 5500 1520"
			mins "-50 -15 -30"
			maxs "0 350 230"
		}

		create
		{
			classname "target_print"
			targetname "blocktrigger"
			scriptname "blocktrigger1"
			angle "0"
			origin "6530 5500 1520"
			message "This Way is not allowed on this server!"
			spawnflags "4"
		}
		
		create
		 {
		 	scriptName "blocktrigger"
			classname "func_fakebrush"
			origin "6512 5330 1520"
			contents "1"
			mins "-50 -15 -30"
			maxs "0 350 230"
		  }
//-------------------------------------------------------------

		create
		 {
		 	scriptName "blocktrigger2"
			classname "func_fakebrush"
			origin "5052 8930 1600"
			contents "1"
			mins "-50 -50 -50"
			maxs "50 50 50"
		  }
		  
		 create
		{
		classname "misc_teleporter_dest"
		origin "5711 9865 1416"
		targetname "misc_teleporter_dest"
		angle "90"
		}

		create
		{
		classname "trigger_teleport"
		target "misc_teleporter_dest"
		targetname "teleportaal"
		origin "610 5420 406"
		mins "-200 -200 -200"
		maxs "200 200 200"
		}
		  
//------------------------Deleting the last axis spawnpoint-------------------------------------
		delete
		{
			targetname "Axis_wobj"
		}
		  
		delete
		{
			origin "610 5486 456"
		}
		  
		delete
		{
			origin "610 5550 456"
		}
		
		delete
		{
			origin "610 5614 456"
		}
		
				delete
		{
			origin "570 5614 456"
		}
		
				delete
		{
			origin "570 5550 456"
		}
		
				delete
		{
			origin "570 5486 456"
		}
		
				delete
		{
			origin "570 5422 456"
		}
		
				delete
		{
			origin "530 5422 456"
		}
		
				delete
		{
			origin "530 5486 456"
		}
		
				delete
		{
			origin "530 5550 456"
		}
		
				delete
		{
			origin "530 5614 456"
		}
		
				delete
		{
			origin "490 5614 456"
		}
		
						delete
		{
			origin "490 5550 456"
		}
		
								delete
		{
			origin "490 5486 456"
		}
		
								delete
		{
			origin "490 5422 456"
		}
		
								delete
		{
			origin "450 5614 456"
		}
		
								delete
		{
			origin "450 5550 456"
		}
		
								delete
		{
			origin "450 5486 456"
		}
		
								delete
		{
			origin "450 5422 456"
		}
		
								delete
		{
			origin "410 5614 456"
		}
		
								delete
		{
			origin "410 5550 456"
		}
		
								delete
		{
			origin "410 5486 456"
		}
		
								delete
		{
			origin "410 5422 456"
		}
		

		wm_axis_respawntime 30 
		wm_allied_respawntime 20 
		wm_number_of_objectives 7
		wm_set_round_timelimit 30 

		// Objectives

		// Primary:

		// 1: Destroy the UFO Cargo
		// 2: Jam the Radar
		// 3: Turn on both Generators

		// Secondary:
	
		// 4: Destroy the Main Gate
		// 5: Destroy the Fence
		// 6: Destroy the Rooftop Access
		// 7: Capture the Forward Spawn
		


		wm_objective_status 1 0 0 // <objective team status>
		wm_objective_status 1 1 0 // status: 0 = default
		wm_objective_status 2 0 0 //		 1 = succeeded
		wm_objective_status 2 1 0 //		 2 = failed
		wm_objective_status 3 0 0
		wm_objective_status 3 1 0
		wm_objective_status 4 0 0
		wm_objective_status 4 1 0
		wm_objective_status 5 0 0
		wm_objective_status 5 1 0
		wm_objective_status 6 0 0
		wm_objective_status 6 1 0
		wm_objective_status 7 0 0
		wm_objective_status 7 1 0	

		

		// Current main objectives for each team (0=Axis, 1=Allies)
		wm_set_main_objective		1	0
		wm_set_main_objective		1	1
		
		accum 5 set 0
		accum 6 set 0
		accum 7 set 0
		

		wm_set_defending_team 0 

		wm_setwinner 0
		
		togglespeaker electroloop
		

		wait 2000
		trigger mdoor1 open_mdoor1
		trigger mdoor2 open_mdoor2
		trigger defensex remove
		trigger gate_body open
		construct defense1

		} 





		trigger flak_counter
	{
		accum 5 inc 1				
		accum 5 abort_if_not_equal 2		

		wm_announce	"^3Allies are teh Win!!!1w1"
		

		wait 300
			
		trigger game_manager checkgame
		
						
	}

	trigger plus
	{


				
		wait 300

		accum 6 inc 1				
		
		accum 6 abort_if_not_equal 2

		trigger game_manager gleich
	}

	trigger minus
	{


				
		wait 300
				
		accum 6 inc -1				
		
		accum 6 abort_if_not_equal -2
		
		trigger game_manager ungleich

	}

		trigger gleich
	{
						
		accum 6 set 0
		wm_announce	"^3Both Generators activated security Doors opening!"
		togglespeaker electroloop
		enablespeaker electroloop1
		alertentity lightning
		wait 3000
		trigger mdoor1 open_mdoor1
		trigger mdoor2 open_mdoor2
		togglespeaker alarm_bgaus
		wait 300
		
		wm_objective_status	3 1 1
		wm_objective_status	3 0 2


	}

		trigger ungleich
	{
						
		accum 6 set 0
		wm_announce	"^3Both Generators deactivated security Doors closing!"
		togglespeaker electroloop
		disablespeaker electroloop1
		alertentity lightning
		wait 3000
		trigger mdoor1 close_mdoor1
		trigger mdoor2 close_mdoor2
		togglespeaker alarm_bgan
		wait 300
		
		wm_objective_status	3 1 2
		wm_objective_status	3 0 1

	}

	trigger checkgame
	{
		
		// Set the round winner:  0 == AXIS, 1 == ALLIED
		wm_setwinner 1

		// End the round
		wm_endround

		wait 500
		
		alertentity allieswin

	}

}



defensex
{
	spawn
	{
		wait 400
		trigger defensex setup

		constructible_class 2
	}

	trigger setup
	{
		setstate defensex_materials invisible
		setstate defensex_materials_clip invisible
		setstate defensex_toi default
		
		
		
	}

	buildstart final
	{
		setstate defensex_materials default
		setstate defensex_materials_clip default
		


		
	}

	built final
	{

		trigger defensex setup
		
		wm_teamvoiceannounce 0 "axis_hq_const_completed"
			
		wm_objective_status	5 1 2
		wm_objective_status	5 0 1
		
		wm_announce "Axis have rebuilt the fence."
		
	}

	decayed final
	{
		setstate defensex_materials default
		setstate defensex_materials_clip default
		


	}

	death
	{
		setstate defensex_materials default
		setstate defensex_materials_clip default
		
		setstate defensex_toi default

		wm_announce "Allies have destroyed the fence."
		
		wm_teamvoiceannounce 1 "allies_obj_dest"
		
		wm_objective_status	5 1 1
		wm_objective_status	5 0 2		

				
	}

	trigger remove
	{
		setstate defensex_toi invisible
		setstate defensex_materials invisible
		setstate defensex_materials_clip invisible
		
		

		remove
	}
}





main_gate
{
 spawn // this is called when the game starts and the entity is spawned
	{
	wait 200
	set
		{
		health "100"
		constructible_class 1 // this indicated that the oasis_wall entity is a dynamitable-only entity... 
		}
	}

death // this is called when the entity is destroyed... 
	{
	wm_announce "^3Allies have destroyed the Gate!"

	wm_teamvoiceannounce 1 "allies_obj_dest"

	wm_teamvoiceannounce 0 "fueldump_axis_wall_destroyed"

		wm_objective_status	4 1 1
		wm_objective_status	4 0 2
	}
}

main_obj
{
 spawn 
	{
	wait 200

	set
		{
		health "100"
		constructible_class 1 // this indicated that the oasis_wall entity is a dynamitable-only entity... 
		}
	}

death 
	{

	setstate forwardspawn1_wobj default	
	setstate forwardspawn1_flag default	

	wm_announce "Allies destroyed Rooftop Entrance!"

	wm_teamvoiceannounce 1 "allies_obj_dest"

	wm_teamvoiceannounce 0 "radar_allies_entrance1_destroyed"

			trigger alliedcpspawns_obj on
			setautospawn	"Allied CP Spawn" 1
			setautospawn	"Forward Spawn"	0

		wm_objective_status	6 1 1
		wm_objective_status	6 0 2

	}
}



main_obj1
{
 spawn 
	{
	wait 200

	setstate 88smoke invisible
	setstate 88smoke1 invisible

	set
		{
		health "100"
		constructible_class 1 // this indicated that the oasis_wall entity is a dynamitable-only entity... 
		}
	}

death 
	{

			

	wm_announce "^3Allies have destroyed the UFO Cargo!"

	wm_teamvoiceannounce 1 "allies_obj_dest"
	
	trigger game_manager flak_counter
	
		wm_objective_status	1 1 1
		wm_objective_status	1 0 2

	wm_teamvoiceannounce 0 "fueldump_axis_wall_destroyed"
	}
}
////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
// *********************************************
// ****************** FLAG STUFF ***************
// *********************************************

goldbar_holder
{
	death
	{
		trigger truck add_goldbar
	}
}

// **********************************************
// ****************** THE  GATE   ***************
// **********************************************
		
the_gate
{
 spawn
 {
	wait 50
		
 }

 trigger open_door
 	{
	trigger gate_body open
	
	}
 trigger close_door
 	{
	trigger gate_body close
	
	}


}


gate_body
{
 spawn
 {
	wait 50

 }

 trigger open
 	{
		wait 50

		alertentity door1_sound
		alertentity door2_sound

		
		gotomarker door1_pos3 8 wait
			
		wait 2000
				
		alertentity doorclose_sound
		alertentity door1_sound
		alertentity door2_sound
			
		wm_announce "Gates are now open!"
		
					
	}

 trigger close
 	{
		wait 50

		alertentity door1_sound
		alertentity door2_sound

		
		gotomarker door1_pos1 8 wait
			
		wait 2000
				
		alertentity doorclose_sound
		alertentity door1_sound
		alertentity door2_sound
			
		wm_announce "Gates are now closed!"
		
					
	}

 
}


the_gateA
{
 spawn
 {
	wait 50
		
 }

 trigger open_door
 	{
	trigger gate_bodyA open
	
	}
 trigger close_door
 	{
	trigger gate_bodyA close
	
	}




}

gate_bodyA
{
 spawn
 {
	wait 50

 }

 trigger open
 	{
		wait 50

		alertentity door1_soundA
		alertentity door2_soundA

		
		gotomarker door1_pos3A 8 wait
			
		wait 2000
				
		alertentity doorclose_soundA
		alertentity door1_soundA
		alertentity door2_soundA
			
		
		
					
	}

 trigger close
 	{
		wait 50

		alertentity door1_soundA
		alertentity door2_soundA

		
		gotomarker door1_pos1A 8 wait
			
		wait 2000
				
		alertentity doorclose_soundA
		alertentity door1_soundA
		alertentity door2_soundA
			
		
		
					
	}

 
}

// *********************************************
// ****************** GOLD STUFF ***************
// *********************************************

gold_crate
{
	spawn
	{
		accum 0 set 0 // gold counter
	}

	trigger stolen
	{
		accum 0 inc 1
		accum 0 trigger_if_equal 1 gold_crate stolen
		
	}

	trigger secured
	{
		wm_announce "^3SECURED!"
		accum 0 trigger_if_equal 1 gold_crate secured
		
	}

	trigger returned
	{
		accum 0 inc -1
		accum 0 trigger_if_equal 0 gold_crate returned
		
	}


	
}

gold_full_0
{
	spawn
	{
		wait 500
		
		faceangles 0 90 0 50

		setstate gold_full_0 invisible
	}

	trigger show
	{
		setstate gold_full_0 default
	}
}



gold_trans_0
{
	spawn
	{
		wait 500
		
		setstate gold_full_0 default
		
		faceangles 0 90 0 50
	}

	trigger hide
	{
		setstate gold_trans_0 invisible
	}
}

truck
{

	spawn
	{
		
	}


	trigger add_goldbar
	{
		accum 0 inc 1
		trigger gold_full_0 show
		trigger gold_trans_0 hide
	

		accum 0 abort_if_less_than 1


		wm_announce "Allied team inserted the Transmitter!"
		
		wm_objective_status	2 1 1
		wm_objective_status	2 0 2	

		wm_addteamvoiceannounce 1 "allies_obj_cap"
		
		trigger game_manager flak_counter

		setstate goldbars_toi invisible
		setstate goldbars_cm_marker invisible
	}
}



//==============================================
//======         TANK BLOCKER 1          =======
//==============================================
defense1
{
	spawn
	{
		wait 400
		trigger defense1 setup

		constructible_class 3
	}

	trigger setup
	{
		setstate defense1_materials default
		setstate defense1_materials_clip default
		setstate defense1_flag default

	}

	buildstart final
	{
		setstate defense1_materials default
		setstate defense1_materials_clip default
		setstate defense1_flag default


	}

	built final
	{
		setstate defense1_materials invisible
		setstate defense1_materials_clip invisible
		setstate defense1_flag invisible
		
		//wm_teamvoiceannounce 1 "af_assaultrampconst"
		
		//wm_announce "Assault Ramp constructed."
		

		
	}

	decayed final
	{
		setstate defense1_materials default
		setstate defense1_materials_clip default
		setstate defense1_flag default


	}

	death
	{
		setstate defense1_materials default
		setstate defense1_materials_clip default
		setstate defense1_flag default



		wm_teamvoiceannounce 0 "af_assaultrampdest"


		wm_announce "Assault Ramp destroyed."


		
		
	}

	trigger remove
	{
		setstate defense1_toi invisible
		setstate defense1_materials invisible
		setstate defense1_materials_clip invisible
		setstate defense1_flag invisible

		
		wm_objective_status	1 1 2
		wm_objective_status	1 0 1

		remove
	}
}

/////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////TRANSFORMER///////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////




buttonbox1
{


 spawn
	{
 	wait 50
	}

 trigger aktiv
	{
	wait 200	
	setstate buttonbox1 default
	}


 trigger inaktiv
	{
	setstate buttonbox1 invisible
	}


}

buttonbox2
{


 spawn
	{
 	wait 50
	setstate buttonbox2 invisible
	}

 trigger aktiv
	{	
	wait 200
	setstate buttonbox2 default
	}


 trigger inaktiv
	{
	setstate buttonbox2 invisible
	}


}



////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////RADAR GATE//////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

buttonbox1_mg
{


 spawn
	{
 	wait 50
	}

 trigger aktiv
	{
	wait 200	
	setstate buttonbox1_mg default
	}


 trigger inaktiv
	{
	setstate buttonbox1_mg invisible
	}


}

buttonbox2_mg
{


 spawn
	{
 	wait 50
	setstate buttonbox2_mg invisible
	}

 trigger aktiv
	{	
	wait 200
	setstate buttonbox2_mg default
	}


 trigger inaktiv
	{
	setstate buttonbox2_mg invisible
	}


}

the_switch_mg
{
 spawn
 {
	wait 50
		
 }

 trigger open_switch
 	{
	trigger switch_body_mg open
	trigger the_gate open_door
	trigger the_gateA open_door
	}



 trigger close_switch
 	{
	trigger switch_body_mg close
	trigger the_gate close_door
	trigger the_gateA close_door
	}
}

switch_body_mg
{
 spawn
 {
	wait 50
	trigger buttonbox2_mg inaktiv
 }

 trigger open
 	{

	gotomarker switch_pos1_mg 8
	wait 100	
	gotomarker switch_pos2_mg 8
	
	trigger buttonbox1_mg inaktiv
	trigger buttonbox2_mg aktiv		
	}

 trigger close
 	{
	
	gotomarker switch_pos2_mg 8
	wait 100
	gotomarker switch_pos1_mg 8

	
	trigger buttonbox1_mg aktiv
	trigger buttonbox2_mg inaktiv
	}



}

// **********************************************
// **************   THE  GATE SWITCH  ***********
// **********************************************
///////////
////LEITUNG A
//////////

leitung_a
{
 spawn
 	{
	wait 50
	}

trigger an
	{
	trigger game_manager plus	
	wm_announce "^3Generator North on!"
	togglespeaker alarm_genaus
	alertentity northgen
	}

trigger aus
	{
	trigger game_manager minus	
	wm_announce "^1Generator North off!"
	togglespeaker alarm_genan
	alertentity northgen
	}
}

		
the_switch
{
 spawn
 {
	wait 50
		
 }

 trigger open_switch
 	{
	trigger switch_body open
	trigger leitung_a an
	}



 trigger close_switch
 	{
	trigger leitung_a aus
	trigger switch_body close
	}
}

switch_body
{
 spawn
 {
	wait 50
	trigger buttonbox2 inaktiv
 }

 trigger open
 	{

	gotomarker switch_pos1 8
	wait 100	
	gotomarker switch_pos2 8

	
	trigger buttonbox1 inaktiv
	trigger buttonbox2 aktiv		
	}

 trigger close
 	{
	
	gotomarker switch_pos2 8
	wait 100
	gotomarker switch_pos1 8

	
	trigger buttonbox1 aktiv
	trigger buttonbox2 inaktiv
	}



}



//////////////////////////////////////////////////////////////////////////////////////////////

buttonbox1B
{


 spawn
	{
 	wait 50
	}

 trigger aktiv
	{
	wait 200	
	setstate buttonbox1B default
	}


 trigger inaktiv
	{
	setstate buttonbox1B invisible
	}


}

buttonbox2B
{


 spawn
	{
 	wait 50
	setstate buttonbox2B invisible
	}

 trigger aktiv
	{	
	wait 200
	setstate buttonbox2B default
	}


 trigger inaktiv
	{
	setstate buttonbox2B invisible
	}


}

// **********************************************
// **************   THE  GATE SWITCH  ***********
// **********************************************
///////////
////LEITUNG B
//////////

leitung_b
{
 spawn
 	{
	wait 50
	}

trigger an
	{
	trigger game_manager plus
	wm_announce "^3Generator South on!"
	togglespeaker alarm_genaus
	alertentity southgen
	}

trigger aus
	{
	trigger game_manager minus
	wm_announce "^1Generator South off!"
	togglespeaker alarm_genan
	alertentity southgen
	}
}

		
the_switchB
{
 spawn
 {
	wait 50
		
 }

 trigger open_switchB
 	{
	trigger switch_bodyB open
	trigger leitung_b an
	}



 trigger close_switchB
 	{
	trigger leitung_b aus
	trigger switch_bodyB close
	}
}

switch_bodyB
{
 spawn
 {
	wait 50
	trigger buttonbox2B inaktiv
 }

 trigger open
 	{

	gotomarker switch_pos1B 8
	wait 100	
	gotomarker switch_pos2B 8

	
	trigger buttonbox1B inaktiv
	trigger buttonbox2B aktiv		
	}

 trigger close
 	{
	
	gotomarker switch_pos2B 8
	wait 100
	gotomarker switch_pos1B 8

	
	trigger buttonbox1B aktiv
	trigger buttonbox2B inaktiv
	}



}

// **********************************************
// **************   THE  MMETAL DOORS  ***********
// **********************************************
		
mdoor1
{
 spawn
 {
	
		
 }

 trigger open_mdoor1
 	{
	wait 500
	trigger mdoor1_body open
	
	}



 trigger close_mdoor1
 	{
	wait 500
	trigger mdoor1_body close
	
	}

}

mdoor1_body
{
 spawn
 {
	
	
 }

 trigger open
 	{
	wait 500	
	gotomarker mdoor1_pos2 15 wait	
	alertentity mdoorend_sound		
	}

 trigger close
 	{
	wait 500
	gotomarker mdoor1_pos1 15 wait
	alertentity mdoorend_sound
	}

}

mdoor2
{
 spawn
 {
	
		
 }

 trigger open_mdoor2
 	{
	wait 500
	trigger mdoor2_body open
	
	}



 trigger close_mdoor2
 	{
	wait 500
	trigger mdoor2_body close
	
	}

}

mdoor2_body
{
 spawn
 {
	
	
 }

 trigger open
 	{
	wait 500	
	gotomarker mdoor2_pos2 15 wait	
	alertentity mdoorend_sound
	alertentity mdoor_sound		
	}

 trigger close
 	{
	wait 500
	gotomarker mdoor2_pos1 15 wait
	alertentity mdoorend_sound
	alertentity mdoor_sound
	}

}

// ================================================
axis_cp_open
{
	spawn
	{
		wait 100
		accum 0 set 0			// 0=CP Closed, 1=CP Damaged
		constructible_class 2			// Dyno+Satchel

		trigger self disable_cp_features		// Default charge bar times
		setstate axis_cp_damaged invisible	// Hide damaged CP clipbrush+model
		setstate axis_cp_damaged_model invisible

		wait 1000
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_construct"
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"
		// *----------------------------------- vo ------------------------------------------*
	}

	trigger disable_cp_features
	{
		setstate axis_cp_open_model invisible	// Hide Open CP model

		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1

		sethqstatus 0 0			// Landmines team warning message
		disablespeaker speaker_axis_cp		// Disable morse code sound
	}

	trigger enable_cp_features
	{
		setstate axis_cp_open_model default	// Show open CP model

		setchargetimefactor 0 soldier 0.75
		setchargetimefactor 0 lieutenant 0.75
		setchargetimefactor 0 medic 0.75
		setchargetimefactor 0 engineer 0.75
		setchargetimefactor 0 covertops 0.75

		sethqstatus 0 1			// Landmines team warning message
		enablespeaker speaker_axis_cp		// Enable morse code sound
	}

	buildstart final
	{
		setstate axis_cp_closed invisible		// Hide closed CP clipbrush+model
		setstate axis_cp_closed_model invisible
		setstate axis_cp_damaged invisible	// Hide damaged CP clipbrush+model
		setstate axis_cp_damaged_model invisible
	}

	built final
	{
		accum 0 set 1			// Only show the damaged CP model
		trigger self enable_cp_features		// Increase charge bar times

		wm_announce "Axis Command Post constructed. Charge speed increased!"
		// *----------------------------------- vo ------------------------------------------*
		wm_removeteamvoiceannounce 0 "axis_hq_compost_construct"
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed_axis"
		wm_addteamvoiceannounce 1 "allies_hq_compost_constructed_axis"
		// *----------------------------------- vo ------------------------------------------*

	}

	decayed final
	{
		setstate axis_cp_open_model invisible	// Hide Open CP model
		trigger self show_damaged_cabinet	// Show previous cabinet state
		trigger self show_closed_cabinet
	}

	death
	{
		trigger self show_damaged_cabinet	// Show damaged CP model
		trigger self disable_cp_features		// Default charge bar times

		wm_announce "Allied team has destroyed the Axis Command Post!"
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_damaged"
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_removeteamvoiceannounce 1 "allies_hq_compost_constructed_axis"
		// *----------------------------------- vo ------------------------------------------*
		
	
	}

	trigger show_closed_cabinet
	{
		accum 0 abort_if_equal 1		// Closed cabinet active yet?
		setstate axis_cp_closed default
		setstate axis_cp_closed_model default
	}

	trigger show_damaged_cabinet
	{
		accum 0 abort_if_equal 0		// Damaged cabinet active yet?
		setstate axis_cp_damaged default
		setstate axis_cp_damaged_model default
	}
}

// ================================================
allied_cp_open
{
	spawn
	{
		wait 100
		accum 0 set 0			// 0=CP Closed, 1=CP Damaged
		constructible_class 2			// Dyno+Satchel

		trigger self disable_cp_features		// Default charge bar times
		setstate allied_cp_damaged invisible	// Hide damaged CP clipbrush+model
		setstate allied_cp_damaged_model invisible

		wait 1000

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "allies_hq_compost_construct"
		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"
		// *----------------------------------- vo ------------------------------------------*
	}

	trigger disable_cp_features
	{
		setstate allied_cp_open_model invisible	// Hide Open CP model

		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1

		sethqstatus 1 0			// Landmines team warning message
		disablespeaker speaker_allied_cp		// Disable morse code sound
	}

	trigger enable_cp_features
	{
		setstate allied_cp_open_model default	// Show open CP model

		setchargetimefactor 1 soldier 0.75
		setchargetimefactor 1 lieutenant 0.75
		setchargetimefactor 1 medic 0.75
		setchargetimefactor 1 engineer 0.75
		setchargetimefactor 1 covertops 0.75

		sethqstatus 1 1			// Landmines team warning message
		enablespeaker speaker_allied_cp		// Enable morse code sound
	}

	buildstart final
	{
		setstate allied_cp_closed invisible		// Hide closed CP clipbrush+model
		setstate allied_cp_closed_model invisible
		setstate allied_cp_damaged invisible	// Hide damaged CP clipbrush+model
		setstate allied_cp_damaged_model invisible
	}

	built final
	{
		accum 0 set 1			// Only show the damaged CP model
		trigger self enable_cp_features		// Increase charge bar times

		wm_announce "Allied Command Post constructed. Charge speed increased!"
		// *----------------------------------- vo ------------------------------------------*
		wm_removeteamvoiceannounce 1 "allies_hq_compost_construct"
		wm_teamvoiceannounce 1 "allies_hq_compost_constructed"

		wm_teamvoiceannounce 0 "axis_hq_compost_constructed_allies"
		wm_addteamvoiceannounce 0 "axis_hq_compost_constructed_allies"
		// *----------------------------------- vo ------------------------------------------*
		
	
	
	}

	decayed final
	{
		setstate allied_cp_open_model invisible	// Hide Open CP model
		trigger self show_damaged_cabinet	// Show previous cabinet state
		trigger self show_closed_cabinet
	}

	death
	{
		trigger self show_damaged_cabinet	// Show damaged CP model
		trigger self disable_cp_features		// Default charge bar times

		wm_announce "Axis team has destroyed the Allied Command Post!"
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "allies_hq_compost_damaged"
		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

		wm_removeteamvoiceannounce 0 "axis_hq_compost_constructed_allies"
		// *----------------------------------- vo ------------------------------------------*
		


	}

	trigger show_closed_cabinet
	{
		accum 0 abort_if_equal 1		// Closed cabinet active yet?
		setstate allied_cp_closed default
		setstate allied_cp_closed_model default
	}

	trigger show_damaged_cabinet
	{
		accum 0 abort_if_equal 0		// Damaged cabinet active yet?
		setstate allied_cp_damaged default
		setstate allied_cp_damaged_model default
	}
}



/////////////////////////////////////////////////////////////

tst_screamingjet
{
	spawn
		{
		wait 100
		}

	trigger start_jet
		{
	trigger screaming_jet move_jet2
	setstate trigger_tst invisible
		wait 1000
		
		}

}

screaming_jet
{
	spawn
	{
		wait 6000

	}

	trigger move_jet1
	{
		gotomarker spln1 100 wait length -32
		setstate trigger_tst default		
	}
	
	trigger move_jet2
	{
		gotomarker spln2 100 wait length -32
		trigger screaming_jet move_jet1		
	}


}


// ============================================================================
// Forward Spawn point - Initially owned by Axis
//
// ============================================================================

forwardspawn1_flag
{
	spawn
	{
		wait 50
		setstate forwardspawn1_flag invisible
		
		accum 0 set 0			// Who owns flag: 0-Axis, 1-Allied
		
	}

	trigger axis_capture				// Touched by an Axis player
	{
		accum 0 abort_if_equal 0 		// do Axis own flag?

		accum 0 set 0 			// Axis own the flag

		wm_announce "^1Axis reclaim the Forward Spawn!"

		wm_teamvoiceannounce 1 "radar_allies_bunker_reclaimed"
		wm_teamvoiceannounce 0 "radar_axis_bunker_reclaimed"

		alertentity forwardspawn1_wobj		// Switch command map marker
		
		setautospawn "Allied CP Spawn"	1	// Set Allied to middle Spawn
		setautospawn "Forward Spawn"	0	// Set Axis to forward spawn
		
		wm_objective_status	7 1 2
		wm_objective_status	7 0 1
	}

	trigger allied_capture				// Touched by an allied player
	{
		accum 0 abort_if_equal 1 		// do Allies own flag?

		accum 0 set 1 			// Allied own the flag
		wm_announce "^3Allies capture the Forward Spawn!"

		wm_teamvoiceannounce 1 "radar_allies_bunker_captured"
		wm_teamvoiceannounce 0 "radar_axis_bunker_captured"

		alertentity forwardspawn1_wobj		// Switch command map marker
		setautospawn "Forward Spawn"	1	// Set Allies to forward spawn
		setautospawn "Axis Spawn"	0	// Set Axis to Axis spawn

		wm_objective_status	7 1 1
		wm_objective_status	7 0 2
	
	}


	trigger kill
	{
		
		remove
	}

	trigger check_obj
	{
		accum 0 abort_if_equal 1 // Do Allied own the flag?



	}

	trigger force_allied
	{
		accum 0 abort_if_equal 1 		// Do Allies own the flag?
		alertentity forwardspawn1_wobj		// Switch command map marker
		alertentity forwardspawn1_spawns		// Switch all spawnpoints
						
	}
	
}

////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////Trigger for the Spawnpoints
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////



alliedcpspawns_obj
{
	spawn
	{
		wait 50
		setstate alliedcpspawns_obj invisible
		setstate alliedcpspawns invisible
	}

	trigger on
	{
		setstate alliedcpspawns_obj default
		setstate alliedcpspawns default
	}

	trigger off
	{
		setstate alliedcpspawns_obj invisible
		setstate alliedcpspawns invisible
	}
}

alliedcpspawns
{
	spawn
	{
		wait 50
		setstate alliedcpspawns invisible
	}
}